/**
  ******************************************************************************
  * @file           : pid.h
	* @author         : jiang kaiyue
  * @brief          : 

  * @attention
 
  ******************************************************************************
  */
	#ifndef __PID_H
  #define __PID_H
	
	typedef struct
	{
	     float kp;
			float ki;
			float kd;
	  float Ref,Meas,Error;
		float LastError;
		float output ;
		float sum;
	}PID_t;
	    typedef struct
	{
	     float kpt;
			float kit;
			float kdt;
	  float Reft,Meast,Errort;
		float LastErrort;
		float outputt ;
		float sumt;
	}PID_tt;
	   typedef struct
	{
	     float kptt;
			float kitt;
			float kdtt;
	  float Reftt,Meastt,Errortt;
		float LastErrortt;
		float outputtt ;
		float sumtt;
	}PID_ttt;
	
		void PID_Init(PID_t *pid,float kp,float ki,float kd);
	 void PID_Initt(PID_tt *pidt,float kpt,float kit,float kdt);
   void PID_Inittt(PID_ttt *pidtt,float kptt,float kitt,float kdt);

	  float PID_Calculate(PID_t *pid,float ref,float meas,float dt);
	  float PID_Calculatet(PID_tt *pid,float reft,float meast,float dt);
	  float PID_Calculatett(PID_ttt *pid,float reftt,float meastt,float dt);
  #endif
